package IViews;

import java.awt.Image;
import javax.swing.ImageIcon;

public class IViewConsts {
	
	final static String resourceFolder = "Images/";
	final static String tmpImageFolder = resourceFolder+"tmp/";
	
	public static ImageIcon loadImageAndResize(String prevImage, int width, int height){
		ImageIcon icon = null;
		//System.out.println(prevImage+":\t"+IViewConsts.class.getResource("/"+resourceFolder+prevImage));
		try {
			icon = new ImageIcon(IViewConsts.class.getResource("/"+resourceFolder+prevImage));
		} catch (Exception e) {
			// TODO: handle exception
			System.out.println(prevImage);
		}
		icon.setImage(icon.getImage().getScaledInstance(width, height, Image.SCALE_SMOOTH));
		
		return icon;
	}
}
